namespace Jackie.Utility.CustomExtension
{
    using System.Text;

    public static class StringBuilderExtension
    {
        private static StringBuilder AddTabs(this StringBuilder sb, int tabNum)
        {
            for (int i = 0; i < tabNum; i++)
            {
                sb.Append("\t");
            }
            return sb;
        }

        public static StringBuilder Append(this StringBuilder sb, int tabNum, string strValue)
        {
            sb.AddTabs(tabNum);
            sb.Append(strValue);
            return sb.Append("\n");
        }

        public static StringBuilder AppendFormat(this StringBuilder sb, int tabNum, string strValue, object object1)
        {
            sb.AddTabs(tabNum);
            sb.AppendFormat(strValue, object1);
            return sb.Append("\n");
        }

        public static StringBuilder AppendFormat(this StringBuilder sb, int tabNum, string strValue, params object[] args)
        {
            sb.AddTabs(tabNum);
            sb.AppendFormat(strValue, args);
            return sb.Append("\n");
        }

        public static StringBuilder AppendFormat(this StringBuilder sb, int tabNum, string strValue, object object1, object object2)
        {
            sb.AddTabs(tabNum);
            sb.AppendFormat(strValue, object1, object2);
            return sb.Append("\n");
        }

        public static StringBuilder AppendFormat(this StringBuilder sb, int tabNum, string strValue, object object1, object object2, object object3)
        {
            sb.AddTabs(tabNum);
            sb.AppendFormat(strValue, object1, object2, object3);
            return sb.Append("\n");
        }
    }
}
